#include <iostream>
#include <vector>
#include <cmath>
#include "Point.h" 
#include <cstdio>
#include <cstdlib>

#define INIFITIY 1000000;
#define NUM_OF_CLUSTERS 4



class Kmean{
    private:
        std::vector<Point> points;
        std::vector<int> clusterIndex;
        std::vector<int> previousIndex;
        std::vector<Point> centroids;
        int dimension;
    	int numOfIterations;

        void calculateNewCentroids();

        void findClosestCentroids();

        double calculateDistance(Point,Point);

        Point calculateMean(std::vector<Point> v);

        Point average(Point,int);

        Point add(Point,Point);

        bool converged();
    public:
        Kmean(std::vector<Point> points,std::vector<Point> centroids,int dimension);

        std::vector<int> getClusters();

        int getDimension();

        void printCentroids();

        void doKmean();
    
    	void printClusters();
    
    	void printPoints();
    
    	void print(Point p);
    
    	void printClusteredPoints();
    
    	void printPointAndCluster(Point,int);
    
    	int getNumOfIterations();





};

